import http from "@/utils/http";
import {EnumAlias} from "@/utils/common";

export function noticePage(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/page`,
    method: "post",
    data
  });
}
export function noticeAdd(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/add`,
    method: "post",
    data
  });
}
export function noticeDelete(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/delete`,
    method: "post",
    data
  });
}
export function noticeUpdate(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/edit`,
    method: "post",
    data
  });
}
// 发布
export function noticePublic(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/public`,
    method: "post",
    data
  });
}
// 撤回
export function noticeCancel(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/cancel`,
    method: "post",
    data
  });
}
// 获取接收的通知公告
export function pageReceived(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/received`,
    method: "get",
    params
  });
}
// 设置通知公告为已读
export function setRead(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/setRead`,
    method: "post",
    data
  });
}
// 全部标记已读
export function noticeReadAll(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/readAll`,
    method: "get",
    params
  });
}
// 删除已接收的通知公告
export function deleteAllReceived(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/deleteAll`,
    method: "get",
    params
  });
}
// 删除已接收的信息
export function deleteOne(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/deleteOne`,
    method: "post",
    data
  });
}
// 获取未读数量
export function getUnReadList(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/notice/getUnReadList`,
    method: "get",
    params
  });
}
/*
 * @Author: moxiaoxi 505271051@qq.com
 * @Date: 2023-04-23 10:18:17
 * @LastEditors: moxiaoxi 505271051@qq.com
 * @LastEditTime: 2023-05-25 15:01:28
 * @FilePath: \selfManagent\src\api\sys\builderTable.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * 数据表分页查询
 * @param {查询条件} data
 */

export function getParameter(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/mqtt/parameter`,
    method: "get",
    params
  });
}
